feat: add private preview workspace foundation - #55
Conversation
Co-Authored-By: Codex <noreply@openai.com>
🤖 Codex PR Review✅ Merge allowed: 1 finding(s) reported but none are blocking ℹ️ Other Findings1. 🟡 [MEDIUM] Reliability in
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 23b0d34fd1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| def test_equivalent_reports_produce_identical_bytes_in_distinct_workspaces(tmp_path): | ||
| first = build_preview_workspace(report(), tmp_path) | ||
| second = build_preview_workspace(report(), tmp_path) |
There was a problem hiding this comment.
Freeze report timestamps before comparing workspace bytes
When the two report() calls in this test straddle a one-second boundary, build_advisory_report() writes a fresh generated_at value via utc_now_iso(), so report.json, report.html, and manifest.json differ even though the workspace builder is deterministic. Reuse a single report snapshot or inject a fixed generated_at before asserting byte-for-byte equality to avoid nondeterministic CI failures.
Useful? React with 👍 / 👎.
Scope
Fresh clean-slate filesystem foundation after frozen PR #54. PR #54 remains closed evidence and is not reused.
This PR adds
build_preview_workspace(report, trusted_parent): the caller supplies only a trusted stable parent; the builder creates an unpredictable mode-0700 private workspace, writes and fsyncs the exact three preview members, performs safe lstat/fstat/readback validation, then returns the path only on success. Failure cleans only the workspace created by this call.Deliberate boundaries
preview_bundle.pybehavior is unchanged; D3 must consume the new API in a later PRVerification
tests/test_preview_workspace.py: 6 passedpython3 -m pytest -q: 287 passedpython3 -m compileall -q src tests: passedgit diff --check: passedDesign:
/Users/lisiyi/Documents/Codex/2026-07-14/ba-2/outputs/qar_preview_private_workspace_foundation_design_v1_2026-07-15.md